<template>
  <!-- <van-cell class="article-item" :to="`/article/${article.art_id}`"> -->
  <van-cell
    class="article-item"
    :to="{ name: 'article', params: { articleId: article.art_id } }"
  >
    <template #title>
      <div class="title van-multi-ellipsis--l2">
        {{ article.title }}
      </div></template
    >
    <template #label>
      <div v-if="article.cover.type === 3" class="cover-wrap">
        <div class="cover-item">
          <van-image
            v-for="(item, i) in article.cover.images"
            :key="i"
            fit="cover"
            :src="item"
          />
        </div>
      </div>
      <div>
        <span>{{ article.aut_name }}</span>
        <span>{{ article.count }}评论</span>
        <span>{{ article.pubdate | relativeTime }}</span>
      </div>
    </template>
    <template #default v-if="article.cover.type === 1"
      ><van-image
        fit="cover"
        :src="article.cover.images[0]"
        class="right-cover"
    /></template>
  </van-cell>
</template>

<script>
export default {
  name: 'ArticleItem',
  commponents: {},
  props: {
    article: {
      type: Object,
      required: true,
    },
  },
  data() {
    return {};
  },
  computed: {},
  watch: {},
  creadted() {},
  mounted() {},
  methods: {},
};
</script>

<style lang="less" scoped>
.cover-wrap {
  padding: 30px 0;
  .cover-item {
    display: flex;
    height: 146px;
    .van-image {
      flex: 1;
      height: 146px;
    }
  }
}
</style>
